package com.symaster.common.geom.show.map.create.button;

import com.symaster.common.geom.show.map.create.EditController;

import javax.swing.*;
import java.awt.event.ActionListener;

public abstract class MyControllerButton extends JButton implements ActionListener {

    public final EditController editController;

    public MyControllerButton(EditController editController) {
        this.editController = editController;
        initListener();
    }

    public MyControllerButton(EditController editController, Icon icon) {
        super(icon);
        this.editController = editController;
        initListener();
    }

    public MyControllerButton(EditController editController, String text) {
        super(text);
        this.editController = editController;
        initListener();
    }

    public MyControllerButton(EditController editController, Action a) {
        super(a);
        this.editController = editController;
        initListener();
    }

    public MyControllerButton(EditController editController, String text, Icon icon) {
        super(text, icon);
        this.editController = editController;
        initListener();
    }

    private void initListener() {
        addActionListener(this);
    }
}